package com.linewell.dao.impl;

import com.linewell.dao.FocusMapper;
import com.linewell.entity.Article;
import com.linewell.entity.Focus;
import com.linewell.entity.Tag;
import com.linewell.entity.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Title: ssm2
 * @description:
 * @author: hyuhuang@linewell.com
 * @since:2018/1/18 16:44
 */
@Repository
public class FocusDao implements FocusMapper {

    @Autowired
    FocusMapper focusMapper;

    public Focus selectAllFocus(Long userId) {
        return focusMapper.selectAllFocus(userId);
    }

    public Focus selectFive(long userId) {
        return focusMapper.selectFive(userId);
    }

    public boolean attention(Long userId, Long focusId) {
        return focusMapper.attention(userId,focusId);
    }

    public List<Focus> selectAttention(Long userId, Long focusId) {
        return focusMapper.selectAttention(userId,focusId);
    }

    public UserInfo selectFocus(Long userId) {
        return focusMapper.selectFocus(userId);
    }

    public UserInfo selectFans(Long focusId) {
        return focusMapper.selectFans(focusId);
    }

    public void updateFocusAndFans(int focusNum, int fansNum, Long userId, Long focusId) {
        focusMapper.updateFocusAndFans(focusNum,fansNum,userId,focusId);
    }

    public List<Tag> selectUserTag(Long userId) {
        return focusMapper.selectUserTag(userId);
    }

    public Article recommendArticle(int tagId) {
        return focusMapper.recommendArticle(tagId);
    }

    public List<Article> selectAllArticle(int tagId) {
        return focusMapper.selectAllArticle(tagId);
    }
}
